package com.yn.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 * 预下单redis缓存前缀
 */
@AllArgsConstructor
@Getter
public enum EnumPreOrderCash {

	PRE_ZY_ORDER("pre_zy_order:", "转运订单"),

	PRE_YXJC_ORDER ("pre_yxjc_order:", "影像检查订单"),

	PRE_ZP_DEVICE_ORDER("pre_zp_device_order:", "租聘设备订单"),

	;

	private String code;

	private String name;


	public static EnumPreOrderCash getByCode(String code) {
		if(StringUtils.isBlank(code)) {
			return null;
		}
		for(EnumPreOrderCash auditStatusEnum : EnumPreOrderCash.values()) {
			if(auditStatusEnum.getCode().equals(code)) {
				return auditStatusEnum;
			}
		}
		return null;
	}

}
